package com.becca.cake.service.fixing;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.becca.cake.core.exception.ServiceException;
import com.becca.cake.model.goods.GoodsFixingModel;
import com.becca.cake.model.system.AdminDO;

/**
 * 配件管理service接口
 * @copyright  尊星(上海)信息科技有限公司
 * @author yellow
 * @date 2016年6月13日 下午7:59:08
 */
public interface IFixingService {
    /**
     * 查询所有配件
     * @param map
     * @return
     * @throws ServiceException
     */
    List<GoodsFixingModel> queryFixings(Map<String, Object> map) throws ServiceException;

    /**
     * 
     * 获取配件数据总条数
     * @param map
     * @return
     * @throws ServiceException
     */
    Long selectFixingCount(Map<String, Object> map) throws ServiceException;

    /**
     * 添加配件信息
     * @param goodsModel
     * @throws ServiceException
     */
    void insertOrUpdateFixing(GoodsFixingModel goodsFixingModel, MultipartFile files,
                              String fileTempPath, AdminDO adminDo) throws Exception;

    /**
     * 启用/禁用配件
     * @param id
     * @throws ServiceException
     */
    void updateIsEnableById(Integer fixingId, Integer isEnable, String trueName)
                                                                                throws ServiceException;

    /**
     * 可选/不可选配件
     * @param id
     * @throws ServiceException
     */
    void updateIsOptionalById(Integer fixingId, Integer isOptional, String trueName)
                                                                                    throws ServiceException;

    /**
     * 根据商品编号查找商品对象
     * @param goodsId
     * @return
     * @throws ServiceException
     */
    GoodsFixingModel selectFixingById(Integer fixingId) throws ServiceException;

}
